<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="stripes"
           uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<stripes:useActionBean beanclass="org.jboss.as.quickstarts.login.stripes.UsersActionBean" var="bean"/>
<!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>Stripes Users</title>
</head>

<body lang="en">
<stripes:messages/>
<stripes:errors/>

<p>Stripes Users</p>
<table>
    <thead>
    <th>Name</th>
    <th>Username</th>
    <th>Password</th>
    </thead>
    <tbody>
    <c:forEach items="${ bean.users }" var="user">
        <tr>
            <td>${user.name}</td>
            <td>${user.username}</td>
            <td>${user.password}</td>
        </tr>
    </c:forEach>
    </tbody>
</table>

<fieldset>
    <legend>New User</legend>
    <stripes:form beanclass="org.jboss.as.quickstarts.login.stripes.AddUserActionBean">
        <table>
            <tbody>
            <tr>
                <td>Name:</td>
                <td><stripes:text name="user.name"/></td>
            </tr>
            <tr>
                <td>Username:</td>
                <td><stripes:text name="user.username"/></td>
            </tr>
            <tr>
                <td>Password:</td>
                <td><stripes:password name="user.password"/></td>
            </tr>
            <tr>
                <td></td>
                <td><stripes:submit name="addUser"/></td>
            </tr>
            </tbody>
        </table>
    </stripes:form>
</fieldset>
</body>
</html>